package com.oscroll.template.lesson.dao;

import com.oscroll.template.lesson.JDBCTemplate;
import com.oscroll.template.lesson.entity.Member;

import javax.sql.DataSource;
import java.sql.ResultSet;
import java.util.List;

public class MemberDao extends JDBCTemplate{

    public MemberDao(DataSource dataSource) {
        super(dataSource);
    }

    public List<Object> query(){
        String sql = "select * from t_member";
        return super.excuteQuery(sql,null);
    }

    @Override
    public Object processResult(ResultSet rs,int rowNum) throws Exception{
        Member member = new Member();
        member.setUsername(rs.getString("username"));
        member.setPassword(rs.getString("password"));
        member.setAddr(rs.getString("addr"));
        return null;
    }
}
